const app = getApp(); //引入导航

import { JqOrder } from 'jqOrder.model.js';
var jqOrder = new JqOrder();
Page({
  data: {
    showIcon: true,
    //显示返回键以及首页
    list_num: 1
  },
  onLoad: function (options) {
    var state = '1';
    this.data.state = state;
    console.log(this.data.state);

    this._loadDate();
  },
  _loadDate: function () {
    jqOrder.getJqOrders(this.data.state, data => {
      console.log(data)
      //查询出演出订单数据
      this.setData({
        'listfint': data
      });
    });
  },
  // 点击切换
  listClick: function (e) {
    var state = e.target.dataset.state;
    this.data.state = state;
    jqOrder.getJqOrders(this.data.state, data => {
      //查询出演出订单数据
      console.log(state, data);
      this.setData({
        'listfint': data,
        'list_num': e.target.dataset.num
      });
    });
  }
});